home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / amiga / gcctls92.lha / hunk2gcc / README < prev   
Text File  |  1992-04-20  |  4KB  |  83 lines

  1. Although I always said, I'll never provide BLINK support for gnu-ld, I sort
  2. of did now. This converter (hunk2gcc) allows you to
  3.   o  convert object files in hunk form into a.out object files
  4.   o  convert ALINK style (ie. concatenated) libraries into a collection of 
  5.      a.out files, that you later can move into an archive with `ar'
  6.  
  7. Since I don't yet have a 3rd edition of the AmigaDOS manual (sigh, I wonder
  8. whether our dear book stores manage to get a copy still this year;-() [they
  9. didn't, it's now April'92 ;-((] I didn't have documentation for the new
  10. hunk types dealing with base relative addressing.  I tried to implement
  11. them based on how the non base relative types work, don't know if I did it
  12. right. Ld does now support base relative symbols, but since I don't have
  13. any hunk format object files containing base relative relocs, I can't
  14. really verify that hunk2gcc translates them correctly (I doubt it does...).
  15. If you find out what needs to be changed, please tell me, I'd like hunk2gcc
  16. to be able to convert small data libraries just as well as it can now
  17. convert large data libraries.
  18.  
  19. I wrote this converter mainly because I didn't like the idea of
  20. disassembling and reassembling amiga.lib, and I really wanted to use those
  21. commodities support functions;-) I tested the converter on amiga.lib, and
  22. (besides generating huge disk traffic...) it seemed to work, at least those
  23. programs I used the library with seem to work as they should.
  24.  
  25. However, I really don't have the necessary amount of object files and
  26. libraries in this format to decide whether I missed one or two cases, so 
  27. please tell me about bugs you find.
  28.  
  29. For the new HUNK_INDEX and HUNK_LIB types:  I asked a friend (that
  30. amazingly got his copy of the 3rd edition somewhere from outer space I
  31. guess;-)) just how I should skip them cleanly..  It turned out that those
  32. hunks are not just additions to the existing hunks, they really replace the
  33. old style hunks, and I just didn't see a reason why I should support this
  34. ugly (IMHO) construction, overall librarians that generate such libraries
  35. should be able to generate oldstyle ALINK libraries as well.
  36.  
  37.  
  38. How to use this tool
  39. --------------------
  40. Best thing is, make a new directory where you want your converted object
  41. files to go, cd into it, and enter
  42.  
  43.   hunk2gcc commo:amiga.lib [..further libs if you like..]
  44.  
  45. This generats an a.out object file for every program unit present in the
  46. hunk file (in this case, from amiga.lib).
  47.  
  48. I first wanted to use the name of the program unit for the name of the
  49. object file, but soon saw that those names are rarely to never useful, they
  50. often aren't even set, and sometimes (hi SAS..) even contain `.c' names,
  51. not right what you usually want as object file;-) Names that are used now
  52. start with `obj.', followed by a serial number, followed by a pattern
  53. built from the task address, such that the generated name is unique and
  54. doesn't overwrite any existing file. 
  55.  
  56. As the final step convert all those files into an a.out style library by
  57. issuing:
  58.  
  59.   ar qc libamiga.a obj.*
  60.   ranlib libamiga.a
  61.  
  62. The ranlib run builds a symbol table in the archive, and makes accesses to
  63. the library much faster.
  64.  
  65. If you just want to convert a single object file, you might give it a
  66. nicer name after the conversion ;-)
  67.  
  68.  
  69. So...  all you SAS users, switching to gcc was never easier!  You can still
  70. use your libraries, just take the large-model/non-regpar libraries, convert
  71. them with oml into oldstyle libraries or just extract all files and run
  72. hunk2gcc over them with `hunk2gcc *'.  You can then start to use the new
  73. driver that calls ld instead of ln (or blink, if you used the BuRP driver),
  74. and got your proper gcc environment.
  75.  
  76.  
  77. HAVE FUN!
  78.  
  79. Markus Wild
  80.  
  81. PS: Please read the header of hunk2gcc.c for copyright/disclaimer.
  82.     You can reach me as <wild@nessie.cs.id.ethz.ch>.
  83.